package cn.icatw.gulimall.seckill.service;

import cn.icatw.gulimall.seckill.to.SeckillSkuRedisTo;

import java.util.List;

/**
 * @author icatw
 * @date 2022/4/4
 * @email 762188827@qq.com
 * @apiNote
 */

public interface SeckillService {
    /**
     * 上传秒杀sku 最近3天
     */
    void uploadSeckillSkuLatest3Days();

    /**
     * 得到当前秒杀sku
     *
     * @return {@link List}<{@link SeckillSkuRedisTo}>
     */
    List<SeckillSkuRedisTo> getCurrentSeckillSkus();

    /**
     * 得到sku秒杀信息
     *
     * @param skuId sku id
     * @return {@link SeckillSkuRedisTo}
     */
    SeckillSkuRedisTo getSkuSeckillInfo(Long skuId);

    /**
     * 杀了
     * 前端秒杀抢购
     *
     * @param killId 杀死id
     * @param key    关键
     * @param num    全国矿工工会
     * @return {@link String}
     * @throws InterruptedException 中断异常
     */
    String kill(String killId, String key, Integer num) throws InterruptedException;
}
